#include "widget.h"
#include "ui_widget.h"

#include <QPushButton>
#include <QGridLayout>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QPushButton* b1 = new QPushButton("按钮1");
    QPushButton* b2 = new QPushButton("按钮2");
    QPushButton* b3 = new QPushButton("按钮3");
    QPushButton* b4 = new QPushButton("按钮4");

    QGridLayout* layout = new QGridLayout();
    layout->addWidget(b1, 0, 0);
    layout->addWidget(b2, 0, 1);
    layout->addWidget(b3, 1, 0);
    layout->addWidget(b4, 1, 1);
    this->setLayout(layout);
}

Widget::~Widget()
{
    delete ui;
}

